module.exports = {
  // publicPath: process.env.NODE_ENV === 'production' ? '/site/vue-demo/' : '/',  
  runtimeCompiler:true,
  transpileDependencies: ['common'],
  chainWebpack: config => {
    config.plugin('html')
      .tap((args) => {
        args[0].title = 'qiankun-example'
        return args
      })
    // config.resolve.alias // 添加别名
    // .set('@', resolve('src'))
    // .set('@assets', resolve('src/assets'))
    // .set('@components', resolve('src/components'))
    // .set('@views', resolve('src/views'))
    // .set('@store', resolve('src/store'));
  },
  devServer: {
    headers: {
      'Access-Control-Allow-Origin': '*'
    },
    proxy: {
      // '/api': {
      //   target: 'http://122.9.86.249:32046',
      //   secure: false
      // },
      '/develop': {
        target: 'http://119.3.107.118:31314', // 开发环境
        secure: false,
        changeOrigin: true,
        pathRewrite: {
          '^/develop/api': '/api'
        }
      },
      /* release */
      '/release': {
        target: 'http://122.9.86.249:32046',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
          '^/release/api': '/api'
        }
      },
      /* prepare */
      '/prepare': {
        target: 'http://122.112.219.67:30669',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
          '^/prepare/api': '/api'
        }
      },
      /* master */
      '/master': {
        target: 'https://1.tongji.edu.cn',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
          '^/master/api': '/api',
          '^/master/sdata': '/sdata'
        }
      },
      /* 调用本地接口*/
      '/liao': {
        target: 'http://10.40.126.227:8110',
        changeOrigin: true,
        pathRewrite: {
          '^/liao': '/'
        }
      },
      '/yuhang': {
        target: 'http://10.40.126.69:8116',
        changeOrigin: true,
        pathRewrite: {
          '^/yuhang': '/'
        }
      },
      '/dongWG': {
        target: 'http://10.40.126.67:8110',
        changeOrigin: true,
        pathRewrite: {
          '^/dongWG': '/'
        }
      },
      /* 数睿后台接口反代配置*/
      '/sdata/rest/': {
        target: 'http://122.112.253.84:8080',
        changeOrigin: true
      },
      /* 数睿资源文件和前台路由反代配置*/
      '/shurui/': {
        target: 'http://122.112.253.84:8080',
        changeOrigin: true
      },
    }
  }
}
